package two_xia.ex9.Demo08;

public class StatePattern {
    public static void main(String[] args) {
        GameRole player = new GameRole();

        // 测试入门级功能
        player.play();
        player.doubleScore();
        player.changeCards();
        player.peekCards();
        System.out.println();

        // 升级到熟练级
        player.setLevelState(new SecondaryState(player));
        player.play();
        player.doubleScore();
        player.changeCards();
        player.peekCards();
        System.out.println();

        // 升级到高手级
        player.setLevelState(new ProfessionalState(player));
        player.play();
        player.doubleScore();
        player.changeCards();
        player.peekCards();
        System.out.println();

        // 升级到骨灰级
        player.setLevelState(new FinalState(player));
        player.play();
        player.doubleScore();
        player.changeCards();
        player.peekCards();
    }
}